import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: "/home",
      component: () => import('@/page/index.vue'),
      meta: {
        title: '首页',
      },
      children: [{
        path: '/home',
        name: 'home',
        component: () => import('@/page/home.vue'),
        meta: {
          title: '欢迎页',
        },
      }, {
        path: '/configure',
        name: 'configure',
        component: () => import('@/page/configure/index.vue'),
        redirect: '/material',
        meta: {
          title: 'menu.basic_conf',
          icon: " icon-jibenpeizhi",
          children: ['/material', '/device', '/phaseConfig', '/metering', '/reason'],
        },
        children: [{
          path: '/material',
          name: 'material',
          component: () => import('@/page/configure/material/material.vue'),
          meta: {
            title: 'basic.material_definition',
            icon: " icon-wuliaodingyi",
            color: "#007DDC"
          },
        }, {
          path: '/device',
          name: 'device',
          component: () => import('@/page/configure/device/device.vue'),
          meta: {
            title: 'basic.device_definition',
            icon: " icon-shebeidingyi",
            color: "#007DDC"
          },
        }, {
          path: '/phaseConfig',
          name: 'phaseConfig',
          component: () => import('@/page/configure/phaseConfig/index.vue'),
          meta: {
            title: 'basic.stage_configuration',
            icon: " icon-xiaoshoujieduanshengqian",
            color: "#007DDC"
          },

        }, {
          path: '/metering',
          name: 'metering',
          component: () => import('@/page/configure/metering/metering.vue'),
          meta: {
            title: 'basic.measurement_unit',
            icon: " icon-jiliangdanwei",
            color: "#007DDC"
          },
        }, {
          path: '/reason',
          name: 'reason',
          component: () => import('@/page/configure/reason/item2/index.vue'),
          meta: {
            title: 'menu.reason_definition',
            icon: " icon-shibaiyuanyin",
            color: "#007DDC"
          },
        }, {
          path: '/enumConfig',
          name: 'enumConfig',
          component: () => import('@/page/configure/enumConfig/index.vue'),
          meta: {
            title: 'basic.enumerating_configurations',
            icon: " icon-shengchan",
            color: "#007DDC"
          },

        },]
      },

      {
        path: '/recipe',
        name: 'recipe',
        component: () => import('@/page/recipe/index.vue'),
        redirect: '/recipeManage',
        meta: {
          title: 'menu.recipe_center',
          icon: " icon-caidanguanli1",
          children: ['/recipeManage', '/createRecipe', '/createUnitRecipe'],
        },
        children: [{
          path: '/recipeManage',
          name: 'recipeManage',
          component: () => import('@/page/recipe/recipeManage/index.vue'),
          meta: {
            title: 'recipe.formula_management',
            icon: " icon-guanli",
            color: "#00A578"
          },
        }, {
          path: '/createRecipe',
          name: 'createRecipe',
          component: () => import('@/page/recipe/createRecipe/index.vue'),
          meta: {
            title: 'recipe.process_formula',
            icon: " icon-chuangjian",
            color: "#00A578"
          },
        },
        {
          path: '/createUnitRecipe',
          name: 'createUnitRecipe',
          component: () => import('@/page/recipe/createUnitRecipe/index.vue'),
          meta: {
            title: 'recipe.equipment_formula',
            icon: " icon-chuangjian",
            color: "#00A578"
          },
        }
        ]
      },


      {
        path: '/scheduling',
        name: 'scheduling',
        component: () => import('@/page/scheduling/index.vue'),
        meta: {
          title: 'menu.production_scheduling',
          icon: " icon-paichanshuju",
          color: "#F38B00"
        },
      },
      {
        path: '/itemInv',
        name: 'itemInv',
        component: () => import('@/page/itemInv/itemInvIndex.vue'),
        meta: {
          title: 'system.iteminv',
          icon: " icon-yijianfankui",
          color: "#C34673"
        },
      },

      {
        path: '/reportForm',
        name: 'reportForm',
        component: () => import('@/page/reportForm/index.vue'),
        // redirect: '/material',
        meta: {
          title: 'menu.report_management',
          icon: " icon-baobiao-xianxing",
          children: ['/reportFormInfo'],
        },
        children: []
      }, {
        path: '/batchInfo',
        name: 'batchInfo',
        component: () => import('@/page/batchInfo/index.vue'),
        meta: {
          title: 'menu.batch_run',
          icon: " icon-jiaohuanpicixinxi",
          color: "#F38B00"
        },
      }, {
        path: '/systemLog',
        name: 'systemLog',
        component: () => import('@/page/systemLog/index.vue'),
        meta: {
          title: 'menu.audit_trail',
          icon: " icon-config-audit",
          color: "#880015"
        },
      }, {
        path: '/approval',
        name: 'approval',
        component: () => import('@/page/approval/index.vue'),
        meta: {
          title: 'menu.approve_mange',
          icon: " icon-shenpi1",
          children: ['/formulaAppr', '/woIdAppr']
        },
        redirect: '/formulaAppr',
        children: [{
          path: '/formulaAppr',
          name: 'formulaAppr',
          component: () => import('@/page/approval/formula/formulaAppr.vue'),
          meta: {
            title: 'approve.formula_approval',
            icon: " icon-tianshenpi",
            color: "#00A578"
          },
        }, {
          path: '/woIdAppr',
          name: 'woIdAppr',
          component: () => import('@/page/approval/workOrder/woIdAppr.vue'),
          meta: {
            title: 'approve.work_order_approval',
            icon: " icon-shenpi",
            color: "#F38B00"
          },
        }]
      }, {
        path: '/deviceStat',
        name: 'deviceStat',
        component: () => import('@/page/deviceStat/index.vue'),
        meta: {
          title: 'other.device_status',
          icon: " icon-shebeizhuangtai1",
          color: "#3F3F3F"
        },
      }, {
        path: '/configManagement',
        name: 'configManagement',
        component: () => import('@/page/configManagement/index.vue'),
        meta: {
          title: 'menu.config',
          icon: " icon-peizhi",
          children: ['/userGroup', '/siteConfig', '/reportConfig', '/menuAdmin']
        },
        redirect: '/userGroup',
        children: [{
          path: '/userGroup',
          name: 'userGroup',
          component: () => import('@/page/configManagement/userGroup/index.vue'),
          meta: {
            title: 'system.permission_management',
            icon: " icon-yonghuzu",
            color: "#879628"
          },
        }, {
          path: '/siteConfig',
          name: 'siteConfig',
          component: () => import('@/page/configManagement/siteConfig/index.vue'),
          meta: {
            title: 'menu.site_configuration',
            icon: " icon-zhandianpeizhi",
            color: "#879628"
          },
        }, {
          path: '/reportConfig',
          name: 'reportConfig',
          component: () => import('@/page/configManagement/reportConfig/index.vue'),
          meta: {
            title: 'menu.report_configuration',
            icon: " icon-baobiaopeizhi",
            color: "#879628"
          },
        }, {
          path: '/menuAdmin',
          name: 'menuAdmin',
          component: () => import('@/page/configManagement/menuAdmin/index.vue'),
          meta: {
            title: 'menu.menu_management',
            icon: " icon-caidanguanli1",
            color: "#879628"
          },
        }, {
          path: '/customPage',
          name: 'customPage',
          component: () => import('@/page/customPage/index.vue'),
          // redirect: '/material',
          meta: {
            title: 'menu.report_management',
            icon: " icon-baobiao-xianxing",
          },
        },
        {
          path: '/servStat',
          name: 'servStat',
          component: () => import('@/page/servStat/index.vue'),
          meta: {
            title: 'system.service_status',
            icon: " icon-shebeizhuangtai1",
            color: "#879628"
          },
        },





        ]
      },
      {
        path: '/model',
        name: 'model',
        component: () => import('@/page/model/index.vue'),
        redirect: '/modelManage',
        meta: {
          title: 'model.model_center',
          icon: " icon-caidanguanli1",
          children: ['/modelManage', '/createRecipe'],
        },
        children: [{
          path: '/modelManage',
          name: 'modelManage',
          component: () => import('@/page/model/modelManage/modelMang.vue'),
          meta: {
            title: 'model.model_mang',
            icon: " icon-baobiao2",
            color: "#8A2BEA"
          },
        },

        {
          path: '/modelConfig',
          name: 'modelConfig',
          component: () => import('@/page/model/modelConfig/configIndex.vue'),
          meta: {
            title: 'model.model_config',
            icon: " icon-peizhi",
            color: "#8A2BEA"
          },
        },
        {
          path: '/modelResult',
          name: 'modelResult',
          component: () => import('@/page/model/modelResult/modelResult.vue'),
          meta: {
            title: 'model.model_ret',
            icon: " icon-baobiao1",
            color: "#8A2BEA"
          },
        },
        {
          path: '/modelInterface',
          name: 'modelInterface',
          component: () => import('@/page/model/modelInterface/index.vue'),
          meta: {
            title: 'model.model_interface',
            icon: " icon-jibenpeizhi",
            color: "#8A2BEA"
          },
        }
        ]
      },
      ]
    }, {
      path: '*', // 匹配所有未被前面路由规则处理的路径
      component: () => import('@/page/NotFoundComponent/404.vue'),
    }]
})

export default router